package com.sunrise.xdoc.service.impl;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import com.sunrise.xdoc.dao.IUserDao;
import com.sunrise.xdoc.entity.user.User;
import com.sunrise.xdoc.service.AbstractService;
import com.sunrise.xdoc.service.IUserService;

@Service("userService")
public class UserService extends AbstractService implements IUserService, UserDetailsService {
	private static final long serialVersionUID = 8621579925480238009L;

	@Override
	public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
		return ((IUserDao) getDaoHelper().getDao(User.class)).loadUserByUsername(username);
	}

}
